package com.kly.user.enums;

public enum LoginType {

    MOBILE(1, "手机登录"),

    GOOGLE(2, "Google登录"),

    FACE_BOOK(3, "FACE_BOOK登录"),

    IOS(4, "IOS登录"),
    ;

    private final int type;

    private final String description;

    public int getType() {
        return type;
    }

    public String getDescription() {
        return description;
    }

    LoginType(int type, String description) {
        this.type = type;
        this.description = description;
    }

    public static LoginType fromType(int type) {
        for (LoginType loginType : values()) {
            if (loginType.getType() == type) {
                return loginType;
            }
        }
        throw new IllegalArgumentException("Invalid login type: " + type);
    }
}
